package org.example;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class Text {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ApplicationContext = new ClassPathXmlApplicationContext("Spring.xml");
        DataSource dataSource =(DataSource) ApplicationContext.getBean("dataSource");
        Connection conn=null;
        try {
            conn=dataSource.getConnection();

        } catch (SQLException e) {
            e.printStackTrace();
        }
        System.out.println(conn);

    }
}
